var Ljs = Ljs || {};

Ljs.Element=function(el){
	this.el=typeof el == "string" ? document.getElementById(el) : el;
	/**
	 * @param html
	 * @param evalScript true|false
	 */
	setInnerHtml=function(html,evalScript){
		var oldEl = this.el;
		if(evalScript)Ljs.util.evalScripts(html);
		/*@cc_on // Pure innerHTML is slightly faster in IE 
		    oldEl.innerHTML = html; 
		    return oldEl; 
		@*/
		var newEl = oldEl.cloneNode(false);  
		newEl.innerHTML = html;  
		oldEl.parentNode.replaceChild(newEl, oldEl); 
		this.el=newEl; 
    	return newEl;  		
	}
	this.evalHtml=function(html){
		return setInnerHtml(html,true);
	}
	/**
	 * @param html null for get,something for set
	 */
	this.html=function(html){
		if(html==undefined)return this.el.innerHTML;
		return setInnerHtml(html);
	}
	this.getElement=function(){
		return this.el;
	}
}

$LE=function(el){
	var e= typeof el == "string" ? Ljs.util.getElement(el) : el;
	return new Ljs.Element(e);
}
